<?php 
  require_once('nav.php');
  //用户id是通过GET方法提交的   
  //根据用户id从数据库中查询用户的所有信息
  /*if(empty($_GET['id'])){
    $sql = 'select * from videos';
  }
  else{
    $sql='select * from videos where vid='.$_GET['id'];
  }*/
  $id = $_GET['id'];  
  $sql = "select * from videos where vid={$id}";   
  /*$result = mysql_query($sql) or die('查询失败！'.mysql_error());  
  $row = mysql_fetch_assoc($result);*/
  $row =fetch_one($sql)

  //var_dump($row);   
    
  //将查询结果显示在表单中
?>
<div class="col-sm-9 col-md-10">
<h1 class="text-center">视频信息编辑</h1>
  <form method="post"  action="videoUpdate.php"  enctype="multipart/form-data" class="form-horizontal">

<div class="form-group">
    <label for="videoname" class="col-md-2 col-xs-3 control-label">编号：</label>
    <div class="col-md-10 col-xs-9">
    <input name="zq_id" type="hidden" class="form-control"  value="<?php echo $id ?>" ><?php echo $id ?>
    </div>
  </div>

  <div class="form-group">
    <label for="videoname" class="col-md-2 col-xs-3 control-label">视频名称：</label>
    <div class="col-md-10 col-xs-9">
    <input name="videoname" type="text" class="form-control" id="videoname" value="<?php echo $row['videoname']; ?>" placeholder="视频名称">
    </div>
  </div>


  <div class="form-group">
    <label class="col-md-2 col-xs-3 control-label" for="tid">视频类型：</label>
    <div class="col-md-10 col-xs-9">
              <select name="tid" class="form-control">
                <option value="0">请选择</option>
                <option value="电影">电影</option> 
                <option value="2">电视剧</option>
                <option value="3">综艺</option>  
                <option value="4">动漫</option>
                <option value="5">体育</option>
                <option value="6">纪录片</option> 
                <option value="7">教育</option>
                <option value="22">动画片</option>  
                <option value="8">冒险</option>
              </select>       
                 </div>
          </div>
  
  <div class="form-group">
    <label for="pic" class="col-md-2 col-xs-3 control-label">海报：</label>
    <div class="col-md-10 col-xs-9">
    <input name="pic" type="file" class="form-control" id="pic" value="<?php echo $row['pic']; ?>" placeholder="海报">
    </div>
  </div>
  <div class="form-group">
    <label for="intro" class="col-md-2 col-xs-3 control-label">内容简介：</label>
    <div class="col-md-10 col-xs-9">
    <input name="intro" type="text" class="form-control" id="intro" rows="5" value="<?php echo $row['intro']; ?>" placeholder="内容简介">
    </div>
  </div>

  <div class="form-group">
    <label for="uploadadmin" class="col-md-2 col-xs-3 control-label">上传用户：</label>
    <div class="col-md-10 col-xs-9">
    <input name="uploadadmin" type="text" class="form-control" id="uploadadmin" value="<?php echo $row['uploadadmin']; ?>" placeholder="上传用户">
    </div>
  </div>
  <div class="form-group">
    <label for="hittimes" class="col-md-2 col-xs-3 control-label">点击率：</label>
    <div class="col-md-10 col-xs-9">
    <input name="hittimes" type="text" class="form-control" id="hittimes" value="<?php echo $row['hittimes']; ?>" placeholder="点击率">
    </div>
  </div>
  <div class="form-group">
    <label for="downtimes" class="col-md-2 col-xs-3 control-label">下载量：</label>
    <div class="col-md-10 col-xs-9">
    <input name="downtimes" type="text" class="form-control" id="downtimes" value="<?php echo $row['downtimes']; ?>" placeholder="下载量">
    </div>
  </div>
  <div class="form-group">
    <label for="address" class="col-md-2 col-xs-3 control-label">下载地址：</label>
    <div class="col-md-10 col-xs-9">
    <input name="address" type="text" class="form-control" id="address" value="<?php echo $row['address']; ?>" placeholder="下载地址">
    </div>
  </div>
  <div class="form-group">
    <div class="col-md-10 col-xs-9 col-md-offset-2 col-xs-offset-3">
    <input type="submit" value="更新">
    <input type="reset" value="重置">
    </div>
  </div>
  </form>
</div>
<?php 
  require_once('footer.php');
?>